<template>
  <div>
    <h1>首页，传入name={{ name }}</h1>
    <div>
      <el-button type="danger" @click="setMutations">mutations设置setCount()--state.count</el-button>
      <el-button type="primary" @click="setActions">actions获取fetchCount()--state.count</el-button>
      <h1>{{ store.state.count }}</h1>
    </div>
    <div>当前站点为：{{ store.state.language=='En'?'国际站 EN':'中文站 CN' }} | language：{{ store.state.lang }}</div>
    <div class="dataeBox">
      <el-date-picker v-model="date" type="date" placeholder="pick a day"></el-date-picker>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { useRouter,useRoute } from 'vue-router'
// import {useStore} from 'vuex'
import { useStore } from '@/store/index.ts'
const store=useStore()

const router=useRouter()
const route=useRoute()

console.log("params",route.params)
const name=route.params.name || 'cevent'

const date=""

function setMutations(){
  store.commit('setCount',100)
}

function setActions(){
  //设置动作派发指向func
  store.dispatch('fetchCount',2)
}

</script>

<style lang="scss" scoped>

</style>